package cn.wzx.mapper;

import cn.wzx.entity.Book;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface BookMapper {
    public List<Book> findAll();
    public Book findById(Integer id);
    public List<Book> findByPage(Map map);
    public int count();
    public void update(Book book);
    public void addBook(Book book);
    public List<Book> findIf(@Param("str") String str, @Param("start") int start, @Param("num") int num);
    public int findIfCount(String str);
    public List<Book> findByPageTypeId(Map map);
    public int countTypeId(Integer typeid);
    public void addRate(Integer bookid);
    public List<Book> findRate5();
    public List<Book> findSale5();
    public List<Book> findFav5();
    public List<Book> findBookByPageRate(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);
    public List<Book> findBookByPageSale(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);
    public List<Book> findBookByPageFav(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);
    public void addFav(@Param("id") Integer id, @Param("num") Integer num);
    public void addSale(@Param("id") Integer id, @Param("num") Integer num);
}
